<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改书籍</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
</head>
<body>
<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-md12">
            <div class="layui-header">
                <h1>
                    <small>修改书籍</small>
                </h1>
            </div>
        </div>
    </div>
    <form class="layui-form" method="post" th:action="@{/updateBook}">
        <input name="bookId" th:value="${book.getBookId()}" type="hidden">
        <div class="layui-form-item">
            <label class="layui-form-label">书籍名称</label>
            <div class="layui-input-inline">
                <input autocomplete="off" class="layui-input" lay-verify="required" name="bookName" placeholder="请输入名称"
                       required th:value="${book.getBookName()}" type="text">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">书籍数量</label>
            <div class="layui-input-inline">
                <input autocomplete="off" class="layui-input" lay-verify="required" name="bookCount" placeholder="请输入数量"
                       required th:value="${book.getBookCount()}" type="number">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">书籍详情</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" name="bookDetail" placeholder="请输入内容"
                          th:text="${book.getBookDetail()}"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-filter="addForm" lay-submit>立即提交</button>
                <button class="layui-btn layui-btn-primary" type="reset">重置</button>
            </div>
        </div>
    </form>
</div>
</body>
<script th:src="@{/layui/layui.js}"></script>
<script>
    layui.use('form', function () {
        var form = layui.form;

        //监听提交
        form.on('submit(addForm)', function (data) {
            return true;
        });
    });
</script>
</html>